import request from "../request/index";

const baseUrl = process.env.VUE_APP_BASE_URL;

export function UserValidation(name, password, code, codeId) {
  var loginfo = `{"name":"${name}","password":${password},"code":"${code}","codeId":"${codeId}"}`;
  console.log("loginfo", eval("(" + loginfo + ")"));
  return request.post(
    `${baseUrl}/Authentication/UserValidation`,
    eval("(" + loginfo + ")")
  );
}

export function GetUserMenus() {
  return request.get(`${baseUrl}/Authentication/GetUserMenus`);
}

export function GetCurrentUse() {
  return request.get(`${baseUrl}/Authentication/GetCurrentUser`);
}

export function GetVerificationCode() {
  return request.get(`${baseUrl}/Authentication/GetVerificationCode`);
}

export function GetUserClients() {
  return request.get(`${baseUrl}/Authentication/GetUserClients`);
}

export function GetCode() {
  return request.get(`${baseUrl}/Authentication/GetCode`);
}
